<template>
  <div class="home-container">
    <div><NavBar /></div>
    
    <div class="content">
      <h1 class="title">中医体质辨识系统</h1>
      <button class="enter-btn" @click="goToMain">进入系统</button>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router';
import NavBar from './NavBar.vue';

const router = useRouter();

const goToMain = () => {
  router.push('/main');
};
</script>

<style scoped>
.home-container {
  width: 100vw;
  height: 100vh;
  background-image: url('../img/background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  overflow: hidden; /* 确保内容不会溢出 */
}

/* 确保NavBar在最上层且宽度正确 */
:deep(.nav-bar) {
  width: 100%;
  z-index: 10;
  position: relative;
}

.home-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 0;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.title {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 4rem;
  color: #f8e6c9;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
  margin-bottom: 2rem;
  letter-spacing: 2px;
  position: relative;
}

.title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #8B4513, transparent);
}

.enter-btn {
  padding: 16px 32px;
  background: linear-gradient(135deg, #8B4513, #A0522D);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1.5rem;
  font-family: 'Ma Shan Zheng', cursive;
  cursor: pointer;
  margin-top: 30px;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.enter-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.enter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #A0522D, #8B4513);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}

.enter-btn:hover::before {
  opacity: 1;
}
:deep(.nav-bar) {
  width: 100%;
  z-index: 10;
  position: relative;
  display: flex; /* 启用弹性布局 */
  justify-content: space-between; /* 内容两端分布 */
  align-items: center; /* 垂直居中 */
  box-sizing: border-box; /* 确保宽度包含内边距和边框 */
}
</style>